import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import utils from './utils'
import "./assets/css/common.css";
import "./assets/css/index.css";
import 'element-plus/dist/index.css'
import './assets/font/font.css';
// import 'element-plus/theme-chalk/display.css'
// import 'element-plus/es/components/message/style/css'
import { ElLoading } from 'element-plus'

// import 'animate.css'
// 这块一定要加,否者会有部分动画无法执行
// import 'animate.css/animate.compat.css'
// import './assets/font/font.css';

const app = createApp(App)
app.config.globalProperties.$utils = utils;
let loading = (func)=>{ 
    var load = ElLoading.service({
        lock: true,
        text: 'Loading',
        background: 'rgba(0, 0, 0, 0.8)',
    })
    
    let time = setTimeout(()=>{
        clearTimeout(time)
        func
        load.close()
    },500)
}

let loadinga = (flag)=>{ 
    var load = ElLoading.service({
        lock: true,
        text: 'Loading',
        background: 'rgba(0, 0, 0, 0.9)',
    })

    if(flag){
        load.close()
    }

    
}
app.config.globalProperties.$loading = loading
app.config.globalProperties.$loadinga = loadinga

app.use(store).use(router).mount('#app')


